package com.gxh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.gxh.annotation.AutoFill;
import com.gxh.dto.EmployeePageQueryDTO;
import com.gxh.entity.Employee;
import com.gxh.enumeration.OperationType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

@Mapper

public interface EmployeeMapper extends BaseMapper<Employee> {

    @Insert("insert into employee(username,name,password,role ,phone,sex,id_number,wx_qrcode,status,create_time,update_time,create_user,update_user) " +
            "values(#{username},#{name},#{password},#{role} ,#{phone},#{sex},#{idNumber},#{wxQrcode},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    @AutoFill(value = OperationType.INSERT)
    void insertEmployee(Employee employee);


    Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);

    @AutoFill(value = OperationType.UPDATE)
    void updateEmployee(Employee employee);
}
